#!/bin/bash
# $Id$

tmpmnt="`mktemp -d /tmp/tmp.XXXXXX`"

for device in /dev/hd[a-z]; do
 mount -o ro -t iso9660 $device $tmpmnt 2> /dev/null
 if [ $? = 0 ]; then
  [ ! -L /dev/cdrom ] && ln -s $device /dev/cdrom
  echo $device > /var/tmp/cdrom_device
  umount $tmpmnt 2>/dev/null
  break
 else
  umount -f $tmpmnt 2>/dev/null
 fi
done

# vim: ts=2
# lookfor-cdrom.sh: end 
